<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateMediaTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateMediaLabel_idmedia}" for="idmedia" />
                    <h:inputText id="idmedia" value="#{mediaController.selected.idmedia}" title="#{bundle.CreateMediaTitle_idmedia}" required="true" requiredMessage="#{bundle.CreateMediaRequiredMessage_idmedia}"/>
                    <h:outputLabel value="#{bundle.CreateMediaLabel_resume}" for="resume" />
                    <h:inputText id="resume" value="#{mediaController.selected.resume}" title="#{bundle.CreateMediaTitle_resume}" />
                    <h:outputLabel value="#{bundle.CreateMediaLabel_title}" for="title" />
                    <h:inputText id="title" value="#{mediaController.selected.title}" title="#{bundle.CreateMediaTitle_title}" />
                    <h:outputLabel value="#{bundle.CreateMediaLabel_idGenre}" for="idGenre" />
                    <h:selectOneMenu id="idGenre" value="#{mediaController.selected.idGenre}" title="#{bundle.CreateMediaTitle_idGenre}" >
                        <f:selectItems value="#{genreController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateMediaLabel_idAuthor}" for="idAuthor" />
                    <h:selectOneMenu id="idAuthor" value="#{mediaController.selected.idAuthor}" title="#{bundle.CreateMediaTitle_idAuthor}" >
                        <f:selectItems value="#{authorController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateMediaLabel_idCategory}" for="idCategory" />
                    <h:selectOneMenu id="idCategory" value="#{mediaController.selected.idCategory}" title="#{bundle.CreateMediaTitle_idCategory}" >
                        <f:selectItems value="#{categoryController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{mediaController.create}" value="#{bundle.CreateMediaSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{mediaController.prepareList}" value="#{bundle.CreateMediaShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateMediaIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
